import React from "react";
import { Form as AntdForm } from "../../antd/index";
import { useForm } from "../../antd/form/Form";
import { FormProvider } from "../../antd/form/context";
import Item from "./Item";
import List from "./List";
import ErrorList from "./ErrorList";
import "./style/index";
// type
import { FormProps } from "../../antd/form";
export type { FormInstance, FormItemProps } from "../../antd/form";
export interface Props extends FormProps {}

class Form extends React.Component<Props> {
  static useForm: typeof useForm;
  static Item: typeof Item;
  static List: typeof List;
  static ErrorList: typeof ErrorList;
  static FormProvider: typeof FormProvider;

  constructor(props: Props) {
    super(props);
  }
  render() {
    const formProps = {
      colon: false,
      ...this.props,
    };
    return <AntdForm {...formProps} />;
  }
}
export { useForm, FormProvider };
export default Form;
